#include <iostream>
#include <stdio.h>
#include "memento.h"

int main(int argv, char**argc)
{
    printf("************  test hello zc!!!   **************\n");
    /* add test code! */
	//创建原发器和负责人 
	UserInfoDTO user;
	Caretaker c;
	
	//定义初始状态 
	user.setAccount("zhangsan");
	user.setPassword("123456");
	user.setTelNo("130000000");
	
	cout << "状态一:" << endl; 
	user.show();
	
	//保存状态 
	c.setMemento(user.saveMemento());
	cout << "----------" << endl;
	
	//更改状态 
	user.setPassword("11111");
	user.setTelNo("131111110");
	cout << "状态二:" << endl;
	user.show();
	cout << "----------" << endl;
	
	//恢复状态 
	user.restoreMemento(c.getMemento());
	cout << "回到状态一:" << endl;
	user.show();
	 

    
    return 0;
}
